import {Box} from "@mui/material";
import FeedSharpIcon from "@mui/icons-material/FeedSharp";
import HandshakeSharpIcon from "@mui/icons-material/HandshakeSharp";
import PrivacyTipSharpIcon from "@mui/icons-material/PrivacyTipSharp";
import InfoSharpIcon from "@mui/icons-material/InfoSharp";
import DGChangeTheme from "../components/DGChangeTheme.tsx";
import DGListViewItem from "../components/DGListViewItem.tsx";
import {useNavigate} from "react-router-dom";
import AppProvider from "../sources/AppProvider.ts";
import {useEffect} from "react";
import DGListView from "../components/DGListView.tsx";
import {ArrowRight} from "@mui/icons-material";
import DGFooterView from "../components/DGFooterView/DGFooterView.tsx";
import DGFadeView from "../components/DGFadeView.tsx";

const DGSettings = () => {
    // 全局上下文
    const App = AppProvider.useAppContext();
    // 路由跳转
    const router = useNavigate();

    // 设置标题
    useEffect(() => {
        if (App) App.setTitle("设置选项");
    }, [App]);

    return (<DGFadeView time={1000}>
        <Box style={{padding: "15px", display: "flex", flexDirection: "column", gap: "15px"}}>
            {/* 更改主题 */}
            <DGChangeTheme/>
            {/* 列表 */}
            <DGListView gap={10} NoBackground>
                {/* 意见反馈 */}
                <DGListViewItem
                    icon={<FeedSharpIcon/>} title="意见反馈" rIcon={<ArrowRight/>} Background
                    onClick={() => router("/feedback", {replace: true})}/>
                {/* 用户协议 */}
                <DGListViewItem
                    icon={<HandshakeSharpIcon/>} title="用户协议" rIcon={<ArrowRight/>} Background
                    onClick={() => router("/agree1", {replace: true})}/>

                {/*  隐私政策*/}
                <DGListViewItem
                    icon={<PrivacyTipSharpIcon/>} title="隐私政策" rIcon={<ArrowRight/>} Background
                    onClick={() => router("/agree2", {replace: true})}/>

                {/* 关于我们 */}
                <DGListViewItem
                    icon={<InfoSharpIcon/>} title="关于我们" rIcon={<ArrowRight/>} Background
                    onClick={() => router("/about", {replace: true})}/>
            </DGListView>
        </Box>
        {/* 底部信息 */}
        <DGFooterView/>
    </DGFadeView>);
}
export default DGSettings;